{% if site.duoshuo_username and page.comments != false %}
<!-- Duoshuo Comment BEGIN -->
<!-- 多说评论框 BEGIN -->
<div class="ds-thread" data-thread-key="{{ page.url }}" data-title="{{ page.title }}" data-url="{{ site.url }}{{ page.url }}"></div>
<!-- 多说评论框 END -->
<!-- 多说公共JS代码 BEGIN (一个网页只需插入一次) -->
<script type="text/javascript">
var duoshuoQuery = {short_name:"{{ site.duoshuo_username }}"};
	(function() {
		var ds = document.createElement('script');
		ds.type = 'text/javascript';ds.async = true;
		ds.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//static.duoshuo.com/embed.js';
		ds.charset = 'UTF-8';
		(document.getElementsByTagName('head')[0]
		 || document.getElementsByTagName('body')[0]).appendChild(ds);
	})();
	</script>
<!-- 多说公共JS代码 END -->
<!-- Duoshuo Comment END -->
{% endif %}

{% if page.comments %}
  <hr>

  <aside id="comments" class="disqus">

    <h2 class="txt-center">Comments</h2>

    <div id="disqus_thread"></div>

    <script type="text/javascript">
      var disqus_shortname = '{{ site.disqus_shortname }}';
      var disqus_identifier = '{{ page.id }}';
      var disqus_title = '{{ page.title }}';
      var disqus_url = '{{ site.url }}{{ post.url }}';
      /*var disqus_developer = 1;*/

      (function() {
          var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
          dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
          (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
      })();
    </script>

    <noscript>
      Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript" rel="nofollow">comments powered by Disqus.</a>
    </noscript>

  </aside>
{% endif %}
